package com.why.jvm.hotspot.src.share.vm.oops;

import com.why.jvm.hotspot.src.share.vm.oops.constants.ConstantUtf8Info;
import lombok.Data;

/**
 * @author xiaoTian
 * @date 2022/7/21 23:14
 * @Description:
 */
@Data
public class SourceFileAttribute extends AttributeInfo{


    private int sourceFileIndex;


    public String getSourceFile(){
        return ((ConstantUtf8Info) getConstantPool().getConstantPoolMap().get(sourceFileIndex)).getValue();
    }

    @Override
    public String toString() {
        return "SourceFileAttribute{" +
                "sourceFileIndex=" + sourceFileIndex +
                "sourceFile=" + getAttributeName() +
                '}';
    }
}
